
package com.base.data.elasticsearch.config;

import com.base.data.elasticsearch.repository.config.BaseElasticsearchRepositoryConfigExtension;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.repository.config.RepositoryBeanDefinitionParser;
import org.springframework.data.repository.config.RepositoryConfigurationExtension;

/**
 * ElasticsearchNamespaceHandler
 */
@Configuration
public class BaseElasticsearchNamespaceHandler extends NamespaceHandlerSupport {

	@Override
	public void init() {
		RepositoryConfigurationExtension extension = new BaseElasticsearchRepositoryConfigExtension();
		RepositoryBeanDefinitionParser parser = new RepositoryBeanDefinitionParser(extension);

		registerBeanDefinitionParser("repositories", parser);
//		registerBeanDefinitionParser("node-client", new NodeClientBeanDefinitionParser());
//		registerBeanDefinitionParser("transport-client", new TransportClientBeanDefinitionParser());
	}
}
